package swagger_plugin

import (
	"gitee.com/kristas/booting-go/framework/core/bean"
	"gitee.com/kristas/booting-go/framework/core/statement/types"
)

type Config struct {
	Info
	BasePath string   `json:"base_path"`
	Host     string   `json:"host"`
	Schemes  []string `json:"schemes"`
}

type Info struct {
	Description    string  `json:"description,omitempty"`
	Version        string  `json:"version,omitempty"`
	TermsOfService string  `json:"termsOfService,omitempty"`
	Title          string  `json:"title,omitempty"`
	Contact        Contact `json:"contact"`
	License        License `json:"license"`
}

type Contact struct {
	Email string `json:"email,omitempty"`
}

type License struct {
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

type SwaggerConfig struct {
	types.Component `name:"swagger_config"`
	Config
}

func NewConfig(config Config) bean.Bean {
	return &SwaggerConfig{
		Config: config,
	}
}
